/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('ddoscoo', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddLayer7CCRuleRequest {
  act?: string(name='Act', description='This parameter is required.', example='close'),
  count?: int32(name='Count', description='This parameter is required.', example='2'),
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  interval?: int32(name='Interval', description='This parameter is required.', example='5'),
  mode?: string(name='Mode', description='This parameter is required.', example='match'),
  name?: string(name='Name', description='This parameter is required.', example='testCcRule1'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  ttl?: int32(name='Ttl', description='This parameter is required.', example='60'),
  uri?: string(name='Uri', description='This parameter is required.', example='/a/b/c'),
}

model AddLayer7CCRuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model AddLayer7CCRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddLayer7CCRuleResponseBody(name='body'),
}

/**
 * @param request AddLayer7CCRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddLayer7CCRuleResponse
 */
async function addLayer7CCRuleWithOptions(request: AddLayer7CCRuleRequest, runtime: Util.RuntimeOptions): AddLayer7CCRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.act)) {
    query['Act'] = request.act;
  }
  if (!Util.isUnset(request.count)) {
    query['Count'] = request.count;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.ttl)) {
    query['Ttl'] = request.ttl;
  }
  if (!Util.isUnset(request.uri)) {
    query['Uri'] = request.uri;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddLayer7CCRule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddLayer7CCRuleRequest
 * @return AddLayer7CCRuleResponse
 */
async function addLayer7CCRule(request: AddLayer7CCRuleRequest): AddLayer7CCRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addLayer7CCRuleWithOptions(request, runtime);
}

model CloseDomainSlsConfigRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.example.com'),
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model CloseDomainSlsConfigResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model CloseDomainSlsConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloseDomainSlsConfigResponseBody(name='body'),
}

/**
 * @param request CloseDomainSlsConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloseDomainSlsConfigResponse
 */
async function closeDomainSlsConfigWithOptions(request: CloseDomainSlsConfigRequest, runtime: Util.RuntimeOptions): CloseDomainSlsConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CloseDomainSlsConfig',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CloseDomainSlsConfigRequest
 * @return CloseDomainSlsConfigResponse
 */
async function closeDomainSlsConfig(request: CloseDomainSlsConfigRequest): CloseDomainSlsConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return closeDomainSlsConfigWithOptions(request, runtime);
}

model ConfigHealthCheckRequest {
  forwardProtocol?: string(name='ForwardProtocol', description='This parameter is required.', example='tcp'),
  frontendPort?: int32(name='FrontendPort', description='This parameter is required.', example='233'),
  healthCheck?: string(name='HealthCheck', description='This parameter is required.', example='{"Type":"tcp","Timeout":10,"Port":80,"Interval":10,"Up":10,"Down":40}"}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ddoscoo-cn-XXXXXX'),
}

model ConfigHealthCheckResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ConfigHealthCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigHealthCheckResponseBody(name='body'),
}

/**
 * @param request ConfigHealthCheckRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigHealthCheckResponse
 */
async function configHealthCheckWithOptions(request: ConfigHealthCheckRequest, runtime: Util.RuntimeOptions): ConfigHealthCheckResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.forwardProtocol)) {
    query['ForwardProtocol'] = request.forwardProtocol;
  }
  if (!Util.isUnset(request.frontendPort)) {
    query['FrontendPort'] = request.frontendPort;
  }
  if (!Util.isUnset(request.healthCheck)) {
    query['HealthCheck'] = request.healthCheck;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigHealthCheck',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigHealthCheckRequest
 * @return ConfigHealthCheckResponse
 */
async function configHealthCheck(request: ConfigHealthCheckRequest): ConfigHealthCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return configHealthCheckWithOptions(request, runtime);
}

model ConfigLayer4RuleRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"xxxxxx-xxxxxx-xxxxxx-xxxxxxx","Protocol":"tcp","FrontendPort":80,"BackendPort":5,"RealServers":"1.1.1.1","2.2.2.2"}]'),
  proxyEnable?: long(name='ProxyEnable'),
  usTimeout?: {
    connectTimeout?: long(name='ConnectTimeout'),
    rsTimeout?: long(name='RsTimeout'),
  }(name='UsTimeout'),
}

model ConfigLayer4RuleShrinkRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"xxxxxx-xxxxxx-xxxxxx-xxxxxxx","Protocol":"tcp","FrontendPort":80,"BackendPort":5,"RealServers":"1.1.1.1","2.2.2.2"}]'),
  proxyEnable?: long(name='ProxyEnable'),
  usTimeoutShrink?: string(name='UsTimeout'),
}

model ConfigLayer4RuleResponseBody = {
  requestId?: string(name='RequestId', example='0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc'),
}

model ConfigLayer4RuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer4RuleResponseBody(name='body'),
}

/**
 * @param tmpReq ConfigLayer4RuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer4RuleResponse
 */
async function configLayer4RuleWithOptions(tmpReq: ConfigLayer4RuleRequest, runtime: Util.RuntimeOptions): ConfigLayer4RuleResponse {
  Util.validateModel(tmpReq);
  var request = new ConfigLayer4RuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.usTimeout)) {
    request.usTimeoutShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.usTimeout, 'UsTimeout', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.listeners)) {
    query['Listeners'] = request.listeners;
  }
  if (!Util.isUnset(request.proxyEnable)) {
    query['ProxyEnable'] = request.proxyEnable;
  }
  if (!Util.isUnset(request.usTimeoutShrink)) {
    query['UsTimeout'] = request.usTimeoutShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer4Rule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer4RuleRequest
 * @return ConfigLayer4RuleResponse
 */
async function configLayer4Rule(request: ConfigLayer4RuleRequest): ConfigLayer4RuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer4RuleWithOptions(request, runtime);
}

model ConfigLayer4RuleAttributeRequest {
  config?: string(name='Config', description='This parameter is required.', example='{"Slimit":{"CpsEnable":1,"MaxconnEnable":1,"Cps":1,"Maxconn":1},"Sla":{"CpsEnable":1,"MaxconnEnable":1,"Cps":100,"Maxconn":1000},"PayloadLen":{"Min":0,"Max":6000}}'),
  forwardProtocol?: string(name='ForwardProtocol', description='This parameter is required.', example='TCP'),
  frontendPort?: int32(name='FrontendPort', description='This parameter is required.', example='233'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ddoscoo-cn-XXXXX'),
}

model ConfigLayer4RuleAttributeResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ConfigLayer4RuleAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer4RuleAttributeResponseBody(name='body'),
}

/**
 * @param request ConfigLayer4RuleAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer4RuleAttributeResponse
 */
async function configLayer4RuleAttributeWithOptions(request: ConfigLayer4RuleAttributeRequest, runtime: Util.RuntimeOptions): ConfigLayer4RuleAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.config)) {
    query['Config'] = request.config;
  }
  if (!Util.isUnset(request.forwardProtocol)) {
    query['ForwardProtocol'] = request.forwardProtocol;
  }
  if (!Util.isUnset(request.frontendPort)) {
    query['FrontendPort'] = request.frontendPort;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer4RuleAttribute',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer4RuleAttributeRequest
 * @return ConfigLayer4RuleAttributeResponse
 */
async function configLayer4RuleAttribute(request: ConfigLayer4RuleAttributeRequest): ConfigLayer4RuleAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer4RuleAttributeWithOptions(request, runtime);
}

model ConfigLayer7BlackWhiteListRequest {
  blackList?: [ string ](name='BlackList', example='1.1.1.1'),
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  whiteList?: [ string ](name='WhiteList', example='1.1.1.1'),
}

model ConfigLayer7BlackWhiteListResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ConfigLayer7BlackWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer7BlackWhiteListResponseBody(name='body'),
}

/**
 * @param request ConfigLayer7BlackWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer7BlackWhiteListResponse
 */
async function configLayer7BlackWhiteListWithOptions(request: ConfigLayer7BlackWhiteListRequest, runtime: Util.RuntimeOptions): ConfigLayer7BlackWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackList)) {
    query['BlackList'] = request.blackList;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.whiteList)) {
    query['WhiteList'] = request.whiteList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer7BlackWhiteList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer7BlackWhiteListRequest
 * @return ConfigLayer7BlackWhiteListResponse
 */
async function configLayer7BlackWhiteList(request: ConfigLayer7BlackWhiteListRequest): ConfigLayer7BlackWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer7BlackWhiteListWithOptions(request, runtime);
}

model ConfigLayer7CCRuleRequest {
  act?: string(name='Act', description='This parameter is required.', example='close'),
  count?: int32(name='Count', description='This parameter is required.', example='2'),
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  interval?: int32(name='Interval', description='This parameter is required.', example='5'),
  mode?: string(name='Mode', description='This parameter is required.', example='match'),
  name?: string(name='Name', description='This parameter is required.', example='testCcRule1'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  ttl?: int32(name='Ttl', description='This parameter is required.', example='60'),
  uri?: string(name='Uri', description='This parameter is required.', example='/a/b/c'),
}

model ConfigLayer7CCRuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ConfigLayer7CCRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer7CCRuleResponseBody(name='body'),
}

/**
 * @param request ConfigLayer7CCRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer7CCRuleResponse
 */
async function configLayer7CCRuleWithOptions(request: ConfigLayer7CCRuleRequest, runtime: Util.RuntimeOptions): ConfigLayer7CCRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.act)) {
    query['Act'] = request.act;
  }
  if (!Util.isUnset(request.count)) {
    query['Count'] = request.count;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.ttl)) {
    query['Ttl'] = request.ttl;
  }
  if (!Util.isUnset(request.uri)) {
    query['Uri'] = request.uri;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer7CCRule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer7CCRuleRequest
 * @return ConfigLayer7CCRuleResponse
 */
async function configLayer7CCRule(request: ConfigLayer7CCRuleRequest): ConfigLayer7CCRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer7CCRuleWithOptions(request, runtime);
}

model ConfigLayer7CCTemplateRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  template?: string(name='Template', description='This parameter is required.', example='default'),
}

model ConfigLayer7CCTemplateResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ConfigLayer7CCTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer7CCTemplateResponseBody(name='body'),
}

/**
 * @param request ConfigLayer7CCTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer7CCTemplateResponse
 */
async function configLayer7CCTemplateWithOptions(request: ConfigLayer7CCTemplateRequest, runtime: Util.RuntimeOptions): ConfigLayer7CCTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.template)) {
    query['Template'] = request.template;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer7CCTemplate',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer7CCTemplateRequest
 * @return ConfigLayer7CCTemplateResponse
 */
async function configLayer7CCTemplate(request: ConfigLayer7CCTemplateRequest): ConfigLayer7CCTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer7CCTemplateWithOptions(request, runtime);
}

model ConfigLayer7CertRequest {
  cert?: string(name='Cert', example='xx'),
  certId?: int32(name='CertId', example='1234'),
  certIdentifier?: string(name='CertIdentifier'),
  certName?: string(name='CertName', example='testCertName'),
  certRegion?: string(name='CertRegion'),
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  key?: string(name='Key', example='xx'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
}

model ConfigLayer7CertResponseBody = {
  requestId?: string(name='RequestId', example='0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc'),
}

model ConfigLayer7CertResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer7CertResponseBody(name='body'),
}

/**
 * @param request ConfigLayer7CertRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer7CertResponse
 */
async function configLayer7CertWithOptions(request: ConfigLayer7CertRequest, runtime: Util.RuntimeOptions): ConfigLayer7CertResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cert)) {
    query['Cert'] = request.cert;
  }
  if (!Util.isUnset(request.certId)) {
    query['CertId'] = request.certId;
  }
  if (!Util.isUnset(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!Util.isUnset(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!Util.isUnset(request.certRegion)) {
    query['CertRegion'] = request.certRegion;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer7Cert',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer7CertRequest
 * @return ConfigLayer7CertResponse
 */
async function configLayer7Cert(request: ConfigLayer7CertRequest): ConfigLayer7CertResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer7CertWithOptions(request, runtime);
}

model ConfigLayer7RuleRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  instanceIds?: [ string ](name='InstanceIds', example='ddoscoo-cn-XXXXXX'),
  proxyTypeList?: string(name='ProxyTypeList', example='[{"ProxyPorts":[80,8080],"ProxyType":"http"},{"ProxyPorts":[443],"ProxyType":"https"}]rts\\\\":[443],\\\\"ProxyType\\\\":\\\\"https\\\\"}]'),
  proxyTypes?: [ string ](name='ProxyTypes', example='[{"ProxyPorts":[80,8080],"ProxyType":"http"},{"ProxyPorts":[443],"ProxyType":"https"}]rts\\\\":[443],\\\\"ProxyType\\\\":\\\\"https\\\\"}]'),
  realServers?: [ string ](name='RealServers', description='This parameter is required.', example='1.1.1.1'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  rsType?: int32(name='RsType', description='This parameter is required.', example='0'),
}

model ConfigLayer7RuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ConfigLayer7RuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigLayer7RuleResponseBody(name='body'),
}

/**
 * @param request ConfigLayer7RuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigLayer7RuleResponse
 */
async function configLayer7RuleWithOptions(request: ConfigLayer7RuleRequest, runtime: Util.RuntimeOptions): ConfigLayer7RuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.proxyTypeList)) {
    query['ProxyTypeList'] = request.proxyTypeList;
  }
  if (!Util.isUnset(request.proxyTypes)) {
    query['ProxyTypes'] = request.proxyTypes;
  }
  if (!Util.isUnset(request.realServers)) {
    query['RealServers'] = request.realServers;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.rsType)) {
    query['RsType'] = request.rsType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigLayer7Rule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ConfigLayer7RuleRequest
 * @return ConfigLayer7RuleResponse
 */
async function configLayer7Rule(request: ConfigLayer7RuleRequest): ConfigLayer7RuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return configLayer7RuleWithOptions(request, runtime);
}

model CreateAsyncTaskRequest {
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  taskParams?: string(name='TaskParams', description='This parameter is required.', example='{"timestamp": 1530276554, "instanceId": "ddoscoo-woieuroi234"}'),
  taskType?: int32(name='TaskType', description='This parameter is required.', example='1'),
}

model CreateAsyncTaskResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model CreateAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAsyncTaskResponseBody(name='body'),
}

/**
 * @param request CreateAsyncTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAsyncTaskResponse
 */
async function createAsyncTaskWithOptions(request: CreateAsyncTaskRequest, runtime: Util.RuntimeOptions): CreateAsyncTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.taskParams)) {
    query['TaskParams'] = request.taskParams;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAsyncTask',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateAsyncTaskRequest
 * @return CreateAsyncTaskResponse
 */
async function createAsyncTask(request: CreateAsyncTaskRequest): CreateAsyncTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAsyncTaskWithOptions(request, runtime);
}

model CreateLayer4RuleRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"xxxxxx-xxxxxx-xxxxxx-xxxxxxx","Protocol":"tcp","FrontendPort":80,"BackendPort":5,"RealServers":"1.1.1.1","2.2.2.2"}]'),
  proxyEnable?: int32(name='ProxyEnable'),
  usTimeout?: {
    connectTimeout?: long(name='ConnectTimeout'),
    rsTimeout?: long(name='RsTimeout'),
  }(name='UsTimeout'),
}

model CreateLayer4RuleShrinkRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"xxxxxx-xxxxxx-xxxxxx-xxxxxxx","Protocol":"tcp","FrontendPort":80,"BackendPort":5,"RealServers":"1.1.1.1","2.2.2.2"}]'),
  proxyEnable?: int32(name='ProxyEnable'),
  usTimeoutShrink?: string(name='UsTimeout'),
}

model CreateLayer4RuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model CreateLayer4RuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLayer4RuleResponseBody(name='body'),
}

/**
 * @param tmpReq CreateLayer4RuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLayer4RuleResponse
 */
async function createLayer4RuleWithOptions(tmpReq: CreateLayer4RuleRequest, runtime: Util.RuntimeOptions): CreateLayer4RuleResponse {
  Util.validateModel(tmpReq);
  var request = new CreateLayer4RuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.usTimeout)) {
    request.usTimeoutShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.usTimeout, 'UsTimeout', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.listeners)) {
    query['Listeners'] = request.listeners;
  }
  if (!Util.isUnset(request.proxyEnable)) {
    query['ProxyEnable'] = request.proxyEnable;
  }
  if (!Util.isUnset(request.usTimeoutShrink)) {
    query['UsTimeout'] = request.usTimeoutShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLayer4Rule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateLayer4RuleRequest
 * @return CreateLayer4RuleResponse
 */
async function createLayer4Rule(request: CreateLayer4RuleRequest): CreateLayer4RuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLayer4RuleWithOptions(request, runtime);
}

model CreateLayer7RuleRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  instanceIds?: [ string ](name='InstanceIds', example='ddoscoo-cn-XXXXX'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  rsType?: int32(name='RsType', description='This parameter is required.', example='0'),
  rules?: string(name='Rules', description='This parameter is required.', example='[{"ProxyRules":[{"ProxyPort":443,"RealServers":["1.1.1.1:443"]}],"ProxyType":"https"},{"ProxyRules":[{"ProxyPort":80,"RealServers":["1.1.1.1:80"]}],"ProxyType":"http"}]'),
}

model CreateLayer7RuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model CreateLayer7RuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLayer7RuleResponseBody(name='body'),
}

/**
 * @param request CreateLayer7RuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLayer7RuleResponse
 */
async function createLayer7RuleWithOptions(request: CreateLayer7RuleRequest, runtime: Util.RuntimeOptions): CreateLayer7RuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.rsType)) {
    query['RsType'] = request.rsType;
  }
  if (!Util.isUnset(request.rules)) {
    query['Rules'] = request.rules;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLayer7Rule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateLayer7RuleRequest
 * @return CreateLayer7RuleResponse
 */
async function createLayer7Rule(request: CreateLayer7RuleRequest): CreateLayer7RuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLayer7RuleWithOptions(request, runtime);
}

model DeleteAsyncTaskRequest {
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  taskId?: int32(name='TaskId', description='This parameter is required.', example='123'),
}

model DeleteAsyncTaskResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DeleteAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAsyncTaskResponseBody(name='body'),
}

/**
 * @param request DeleteAsyncTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAsyncTaskResponse
 */
async function deleteAsyncTaskWithOptions(request: DeleteAsyncTaskRequest, runtime: Util.RuntimeOptions): DeleteAsyncTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAsyncTask',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteAsyncTaskRequest
 * @return DeleteAsyncTaskResponse
 */
async function deleteAsyncTask(request: DeleteAsyncTaskRequest): DeleteAsyncTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAsyncTaskWithOptions(request, runtime);
}

model DeleteLayer4RuleRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='{"InstanceId":"0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc","Protocol":"tcp","FrontendPort":80}'),
}

model DeleteLayer4RuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DeleteLayer4RuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLayer4RuleResponseBody(name='body'),
}

/**
 * @param request DeleteLayer4RuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLayer4RuleResponse
 */
async function deleteLayer4RuleWithOptions(request: DeleteLayer4RuleRequest, runtime: Util.RuntimeOptions): DeleteLayer4RuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.listeners)) {
    query['Listeners'] = request.listeners;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLayer4Rule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteLayer4RuleRequest
 * @return DeleteLayer4RuleResponse
 */
async function deleteLayer4Rule(request: DeleteLayer4RuleRequest): DeleteLayer4RuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLayer4RuleWithOptions(request, runtime);
}

model DeleteLayer7CCRuleRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  name?: string(name='Name', description='This parameter is required.', example='testCcRule1'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
}

model DeleteLayer7CCRuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DeleteLayer7CCRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLayer7CCRuleResponseBody(name='body'),
}

/**
 * @param request DeleteLayer7CCRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLayer7CCRuleResponse
 */
async function deleteLayer7CCRuleWithOptions(request: DeleteLayer7CCRuleRequest, runtime: Util.RuntimeOptions): DeleteLayer7CCRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLayer7CCRule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteLayer7CCRuleRequest
 * @return DeleteLayer7CCRuleResponse
 */
async function deleteLayer7CCRule(request: DeleteLayer7CCRuleRequest): DeleteLayer7CCRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLayer7CCRuleWithOptions(request, runtime);
}

model DeleteLayer7RuleRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
}

model DeleteLayer7RuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DeleteLayer7RuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLayer7RuleResponseBody(name='body'),
}

/**
 * @param request DeleteLayer7RuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLayer7RuleResponse
 */
async function deleteLayer7RuleWithOptions(request: DeleteLayer7RuleRequest, runtime: Util.RuntimeOptions): DeleteLayer7RuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLayer7Rule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteLayer7RuleRequest
 * @return DeleteLayer7RuleResponse
 */
async function deleteLayer7Rule(request: DeleteLayer7RuleRequest): DeleteLayer7RuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLayer7RuleWithOptions(request, runtime);
}

model DescribeBackSourceCidrRequest {
  ipVersion?: string(name='IpVersion'),
  line?: string(name='Line', example='coop-line-001'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeBackSourceCidrResponseBody = {
  cidrList?: [ string ](name='CidrList'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeBackSourceCidrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackSourceCidrResponseBody(name='body'),
}

/**
 * @param request DescribeBackSourceCidrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackSourceCidrResponse
 */
async function describeBackSourceCidrWithOptions(request: DescribeBackSourceCidrRequest, runtime: Util.RuntimeOptions): DescribeBackSourceCidrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipVersion)) {
    query['IpVersion'] = request.ipVersion;
  }
  if (!Util.isUnset(request.line)) {
    query['Line'] = request.line;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackSourceCidr',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackSourceCidrRequest
 * @return DescribeBackSourceCidrResponse
 */
async function describeBackSourceCidr(request: DescribeBackSourceCidrRequest): DescribeBackSourceCidrResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackSourceCidrWithOptions(request, runtime);
}

model DescribeBatchSlsDispatchStatusRequest {
  lang?: string(name='Lang', example='cn'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeBatchSlsDispatchStatusResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  slsConfigStatusList?: [ 
    {
      domain?: string(name='Domain', example='www.example.com'),
      enable?: boolean(name='Enable', example='true'),
    }
  ](name='SlsConfigStatusList'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeBatchSlsDispatchStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBatchSlsDispatchStatusResponseBody(name='body'),
}

/**
 * @summary rosetta迁移
 *
 * @param request DescribeBatchSlsDispatchStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBatchSlsDispatchStatusResponse
 */
async function describeBatchSlsDispatchStatusWithOptions(request: DescribeBatchSlsDispatchStatusRequest, runtime: Util.RuntimeOptions): DescribeBatchSlsDispatchStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBatchSlsDispatchStatus',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary rosetta迁移
 *
 * @param request DescribeBatchSlsDispatchStatusRequest
 * @return DescribeBatchSlsDispatchStatusResponse
 */
async function describeBatchSlsDispatchStatus(request: DescribeBatchSlsDispatchStatusRequest): DescribeBatchSlsDispatchStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBatchSlsDispatchStatusWithOptions(request, runtime);
}

model DescribeDDoSEventsRequest {
  eip?: string(name='Eip', description='This parameter is required.', example='1.1.1.1'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='3289457324'),
  offset?: int32(name='Offset', description='This parameter is required.', example='1'),
  pageSize?: string(name='PageSize', description='This parameter is required.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='3289457398'),
}

model DescribeDDoSEventsResponseBody = {
  events?: [ 
    {
      endTime?: long(name='EndTime', example='3289457398'),
      interval?: int32(name='Interval', example='12'),
      startTime?: long(name='StartTime', example='3289457324'),
      status?: string(name='Status', example='blackhole_start'),
    }
  ](name='Events'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: long(name='Total', example='1'),
}

model DescribeDDoSEventsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDDoSEventsResponseBody(name='body'),
}

/**
 * @param request DescribeDDoSEventsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDDoSEventsResponse
 */
async function describeDDoSEventsWithOptions(request: DescribeDDoSEventsRequest, runtime: Util.RuntimeOptions): DescribeDDoSEventsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eip)) {
    query['Eip'] = request.eip;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDDoSEvents',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDDoSEventsRequest
 * @return DescribeDDoSEventsResponse
 */
async function describeDDoSEvents(request: DescribeDDoSEventsRequest): DescribeDDoSEventsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDDoSEventsWithOptions(request, runtime);
}

model DescribeDDoSTrafficRequest {
  eip?: string(name='Eip', description='This parameter is required.', example='1.1.1.1'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='3289457398'),
  interval?: int32(name='Interval', description='This parameter is required.', example='60'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='3289457324'),
}

model DescribeDDoSTrafficResponseBody = {
  DDoSTrafficPoints?: [ 
    {
      defenseMaxInBps?: long(name='DefenseMaxInBps', example='129867'),
      sourceMaxInBps?: long(name='SourceMaxInBps', example='129867'),
      time?: long(name='Time', example='234082304'),
    }
  ](name='DDoSTrafficPoints'),
  defenseInBytes?: long(name='DefenseInBytes', example='23482234'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  sourceInBytes?: long(name='SourceInBytes', example='19284762'),
}

model DescribeDDoSTrafficResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDDoSTrafficResponseBody(name='body'),
}

/**
 * @param request DescribeDDoSTrafficRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDDoSTrafficResponse
 */
async function describeDDoSTrafficWithOptions(request: DescribeDDoSTrafficRequest, runtime: Util.RuntimeOptions): DescribeDDoSTrafficResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eip)) {
    query['Eip'] = request.eip;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDDoSTraffic',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDDoSTrafficRequest
 * @return DescribeDDoSTrafficResponse
 */
async function describeDDoSTraffic(request: DescribeDDoSTrafficRequest): DescribeDDoSTrafficResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDDoSTrafficWithOptions(request, runtime);
}

model DescribeDefenseCountStatisticsRequest {
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeDefenseCountStatisticsResponseBody = {
  defenseCountStatistics?: {
    defenseCountTotalUsageOfCurrentMonth?: int32(name='DefenseCountTotalUsageOfCurrentMonth', example='0'),
    flowPackCountRemain?: int32(name='FlowPackCountRemain', example='10'),
    maxUsableDefenseCountCurrentMonth?: int32(name='MaxUsableDefenseCountCurrentMonth', example='0'),
  }(name='DefenseCountStatistics'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeDefenseCountStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDefenseCountStatisticsResponseBody(name='body'),
}

/**
 * @param request DescribeDefenseCountStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDefenseCountStatisticsResponse
 */
async function describeDefenseCountStatisticsWithOptions(request: DescribeDefenseCountStatisticsRequest, runtime: Util.RuntimeOptions): DescribeDefenseCountStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDefenseCountStatistics',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDefenseCountStatisticsRequest
 * @return DescribeDefenseCountStatisticsResponse
 */
async function describeDefenseCountStatistics(request: DescribeDefenseCountStatisticsRequest): DescribeDefenseCountStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDefenseCountStatisticsWithOptions(request, runtime);
}

model DescribeDomainAccessModeRequest {
  domainList?: [ string ](name='DomainList', description='This parameter is required.', example='www.aliyun.com'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeDomainAccessModeResponseBody = {
  domainModeList?: [ 
    {
      accessMode?: int32(name='AccessMode', example='1'),
      domain?: string(name='Domain', example='www.aliyun.com'),
    }
  ](name='DomainModeList'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeDomainAccessModeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainAccessModeResponseBody(name='body'),
}

/**
 * @param request DescribeDomainAccessModeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainAccessModeResponse
 */
async function describeDomainAccessModeWithOptions(request: DescribeDomainAccessModeRequest, runtime: Util.RuntimeOptions): DescribeDomainAccessModeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainList)) {
    query['DomainList'] = request.domainList;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainAccessMode',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainAccessModeRequest
 * @return DescribeDomainAccessModeResponse
 */
async function describeDomainAccessMode(request: DescribeDomainAccessModeRequest): DescribeDomainAccessModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainAccessModeWithOptions(request, runtime);
}

model DescribeDomainAttackEventListRequest {
  domain?: string(name='Domain', example='example.aliyundoc.com'),
  endTime?: long(name='EndTime', example='1668740400'),
  pageNo?: int32(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', example='default'),
  startTime?: long(name='StartTime', example='1681966800'),
}

model DescribeDomainAttackEventListResponseBody = {
  dataList?: [ 
    {
      domain?: string(name='Domain', example='example.aliyundoc.com'),
      endTime?: long(name='EndTime', example='1670918400'),
      maxQps?: long(name='MaxQps', example='300'),
      startTime?: long(name='StartTime', example='1666083600'),
    }
  ](name='DataList'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: long(name='Total', example='10'),
}

model DescribeDomainAttackEventListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainAttackEventListResponseBody(name='body'),
}

/**
 * @param request DescribeDomainAttackEventListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainAttackEventListResponse
 */
async function describeDomainAttackEventListWithOptions(request: DescribeDomainAttackEventListRequest, runtime: Util.RuntimeOptions): DescribeDomainAttackEventListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainAttackEventList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainAttackEventListRequest
 * @return DescribeDomainAttackEventListResponse
 */
async function describeDomainAttackEventList(request: DescribeDomainAttackEventListRequest): DescribeDomainAttackEventListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainAttackEventListWithOptions(request, runtime);
}

model DescribeDomainAttackMaxQpsRequest {
  domain?: string(name='Domain', example='example.aliyundoc.com'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='1667801940'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2pz25js****'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1657562370'),
}

model DescribeDomainAttackMaxQpsResponseBody = {
  qps?: string(name='Qps', example='613'),
  requestId?: string(name='RequestId', example='62F9BD81-8BCA-5B23-A3CB-3FB7CEB7A4CA'),
}

model DescribeDomainAttackMaxQpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainAttackMaxQpsResponseBody(name='body'),
}

/**
 * @param request DescribeDomainAttackMaxQpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainAttackMaxQpsResponse
 */
async function describeDomainAttackMaxQpsWithOptions(request: DescribeDomainAttackMaxQpsRequest, runtime: Util.RuntimeOptions): DescribeDomainAttackMaxQpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainAttackMaxQps',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainAttackMaxQpsRequest
 * @return DescribeDomainAttackMaxQpsResponse
 */
async function describeDomainAttackMaxQps(request: DescribeDomainAttackMaxQpsRequest): DescribeDomainAttackMaxQpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainAttackMaxQpsWithOptions(request, runtime);
}

model DescribeDomainOverviewRequest {
  domain?: string(name='Domain', example='example.aliyundoc.com'),
  endTime?: long(name='EndTime', example='1651809600'),
  resourceGroupId?: string(name='ResourceGroupId', example='default'),
  startTime?: long(name='StartTime', example='1619798400'),
}

model DescribeDomainOverviewResponseBody = {
  maxHttp?: long(name='MaxHttp', example='0'),
  maxHttps?: long(name='MaxHttps', example='0'),
  requestId?: string(name='RequestId', example='C33EB3D5-AF96-43CA-9C7E-37A81BC06A1E'),
}

model DescribeDomainOverviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainOverviewResponseBody(name='body'),
}

/**
 * @param request DescribeDomainOverviewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainOverviewResponse
 */
async function describeDomainOverviewWithOptions(request: DescribeDomainOverviewRequest, runtime: Util.RuntimeOptions): DescribeDomainOverviewResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainOverview',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainOverviewRequest
 * @return DescribeDomainOverviewResponse
 */
async function describeDomainOverview(request: DescribeDomainOverviewRequest): DescribeDomainOverviewResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainOverviewWithOptions(request, runtime);
}

model DescribeDomainQpsListRequest {
  domain?: string(name='Domain', example='example.aliyundoc.com'),
  endTime?: long(name='EndTime', example='1657162260'),
  interval?: long(name='Interval', description='This parameter is required.', example='1800'),
  resourceGroupId?: string(name='ResourceGroupId', example='default'),
  startTime?: long(name='StartTime', example='1672362360'),
}

model DescribeDomainQpsListResponseBody = {
  dataList?: [ 
    {
      attackQps?: long(name='AttackQps'),
      cacheHits?: long(name='CacheHits'),
      index?: long(name='Index'),
      maxAttackQps?: long(name='MaxAttackQps'),
      maxNormalQps?: long(name='MaxNormalQps'),
      maxQps?: long(name='MaxQps'),
      totalCount?: long(name='TotalCount'),
      totalQps?: long(name='TotalQps'),
    }
  ](name='DataList'),
  requestId?: string(name='RequestId'),
}

model DescribeDomainQpsListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainQpsListResponseBody(name='body'),
}

/**
 * @param request DescribeDomainQpsListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainQpsListResponse
 */
async function describeDomainQpsListWithOptions(request: DescribeDomainQpsListRequest, runtime: Util.RuntimeOptions): DescribeDomainQpsListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainQpsList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainQpsListRequest
 * @return DescribeDomainQpsListResponse
 */
async function describeDomainQpsList(request: DescribeDomainQpsListRequest): DescribeDomainQpsListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainQpsListWithOptions(request, runtime);
}

model DescribeDomainQpsWithCacheRequest {
  domain?: string(name='Domain', example='www.example.com'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='1577796336'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1577794536'),
}

model DescribeDomainQpsWithCacheResponseBody = {
  blocks?: [ string ](name='Blocks'),
  cacheHits?: [ string ](name='CacheHits'),
  ccBlockQps?: [ string ](name='CcBlockQps'),
  ccJsQps?: [ string ](name='CcJsQps'),
  interval?: int32(name='Interval', example='60'),
  ipBlockQps?: [ string ](name='IpBlockQps'),
  preciseBlocks?: [ string ](name='PreciseBlocks'),
  preciseJsQps?: [ string ](name='PreciseJsQps'),
  regionBlocks?: [ string ](name='RegionBlocks'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  startTime?: long(name='StartTime', example='1577794500'),
  totals?: [ string ](name='Totals'),
}

model DescribeDomainQpsWithCacheResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainQpsWithCacheResponseBody(name='body'),
}

/**
 * @param request DescribeDomainQpsWithCacheRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainQpsWithCacheResponse
 */
async function describeDomainQpsWithCacheWithOptions(request: DescribeDomainQpsWithCacheRequest, runtime: Util.RuntimeOptions): DescribeDomainQpsWithCacheResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainQpsWithCache',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainQpsWithCacheRequest
 * @return DescribeDomainQpsWithCacheResponse
 */
async function describeDomainQpsWithCache(request: DescribeDomainQpsWithCacheRequest): DescribeDomainQpsWithCacheResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainQpsWithCacheWithOptions(request, runtime);
}

model DescribeDomainSlsStatusRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.example.com'),
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeDomainSlsStatusResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  slsLogstore?: string(name='SlsLogstore', example='ddoscoo-logstore'),
  slsProject?: string(name='SlsProject', example='ddoscoo-project-xxxx-cn-hangzhou'),
  slsStatus?: boolean(name='SlsStatus', example='true'),
}

model DescribeDomainSlsStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainSlsStatusResponseBody(name='body'),
}

/**
 * @param request DescribeDomainSlsStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainSlsStatusResponse
 */
async function describeDomainSlsStatusWithOptions(request: DescribeDomainSlsStatusRequest, runtime: Util.RuntimeOptions): DescribeDomainSlsStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainSlsStatus',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainSlsStatusRequest
 * @return DescribeDomainSlsStatusResponse
 */
async function describeDomainSlsStatus(request: DescribeDomainSlsStatusRequest): DescribeDomainSlsStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainSlsStatusWithOptions(request, runtime);
}

model DescribeDomainStatusCodeListRequest {
  domain?: string(name='Domain', example='example.aliyundoc.com'),
  endTime?: long(name='EndTime', example='1583683200'),
  interval?: long(name='Interval', example='1800'),
  queryType?: string(name='QueryType', description='This parameter is required.', example='upstream'),
  resourceGroupId?: string(name='ResourceGroupId', example='default'),
  startTime?: long(name='StartTime', example='1582992000'),
}

model DescribeDomainStatusCodeListResponseBody = {
  requestId?: string(name='RequestId', example='3B63C0DD-8AC5-44B2-95D6-064CA9296B9C'),
  statusCodeList?: [ 
    {
      index?: int32(name='Index', example='0'),
      status200?: long(name='Status200', example='320'),
      status2XX?: long(name='Status2XX', example='5776'),
      status3XX?: long(name='Status3XX', example='0'),
      status403?: long(name='Status403', example='0'),
      status404?: long(name='Status404', example='34'),
      status405?: long(name='Status405', example='11'),
      status410?: long(name='Status410'),
      status499?: long(name='Status499'),
      status4XX?: long(name='Status4XX', example='168'),
      status501?: long(name='Status501', example='0'),
      status502?: long(name='Status502', example='3'),
      status503?: long(name='Status503', example='0'),
      status504?: long(name='Status504', example='0'),
      status5XX?: long(name='Status5XX', example='7'),
    }
  ](name='StatusCodeList'),
}

model DescribeDomainStatusCodeListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainStatusCodeListResponseBody(name='body'),
}

/**
 * @summary 查询网站业务的响应状态码统计信息
 *
 * @param request DescribeDomainStatusCodeListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainStatusCodeListResponse
 */
async function describeDomainStatusCodeListWithOptions(request: DescribeDomainStatusCodeListRequest, runtime: Util.RuntimeOptions): DescribeDomainStatusCodeListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainStatusCodeList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询网站业务的响应状态码统计信息
 *
 * @param request DescribeDomainStatusCodeListRequest
 * @return DescribeDomainStatusCodeListResponse
 */
async function describeDomainStatusCodeList(request: DescribeDomainStatusCodeListRequest): DescribeDomainStatusCodeListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainStatusCodeListWithOptions(request, runtime);
}

model DescribeDomainsRequest {
  domain?: string(name='Domain', example='www.aliyun.com'),
  instanceIds?: [ string ](name='InstanceIds', example='ddoscoo-cn-XXXXXX'),
  offset?: int32(name='Offset', description='This parameter is required.', example='0'),
  pageSize?: string(name='PageSize', description='This parameter is required.', example='10'),
  queryDomainPattern?: string(name='QueryDomainPattern', example='fuzzy'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeDomainsResponseBody = {
  domains?: [ 
    {
      blackList?: [ string ](name='BlackList'),
      ccEnabled?: boolean(name='CcEnabled', example='true'),
      ccRuleEnabled?: boolean(name='CcRuleEnabled', example='true'),
      ccTemplate?: string(name='CcTemplate', example='normal'),
      certName?: string(name='CertName', example='testCertName'),
      certRegion?: string(name='CertRegion'),
      cname?: string(name='Cname', example='xxxxxxx.aliyunddos1006.com'),
      domain?: string(name='Domain', example='www.aliyun.com'),
      http2Enable?: boolean(name='Http2Enable', example='true'),
      proxyTypeList?: [ 
        {
          proxyPorts?: [ string ](name='ProxyPorts'),
          proxyType?: string(name='ProxyType', example='http'),
        }
      ](name='ProxyTypeList'),
      realServers?: [ 
        {
          realServer?: string(name='RealServer', example='1.1.1.1'),
          rsType?: int32(name='RsType', example='0'),
        }
      ](name='RealServers'),
      sslCiphers?: string(name='SslCiphers', example='xx'),
      sslProtocols?: string(name='SslProtocols', example='xx'),
      whiteList?: [ string ](name='WhiteList'),
    }
  ](name='Domains'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: long(name='Total', example='10'),
}

model DescribeDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainsResponseBody(name='body'),
}

/**
 * @param request DescribeDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainsResponse
 */
async function describeDomainsWithOptions(request: DescribeDomainsRequest, runtime: Util.RuntimeOptions): DescribeDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryDomainPattern)) {
    query['QueryDomainPattern'] = request.queryDomainPattern;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomains',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDomainsRequest
 * @return DescribeDomainsResponse
 */
async function describeDomains(request: DescribeDomainsRequest): DescribeDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainsWithOptions(request, runtime);
}

model DescribeElasticBandwidthSpecRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ddoscoo-cn-XXXXX'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeElasticBandwidthSpecResponseBody = {
  elasticBandwidthSpec?: [ string ](name='ElasticBandwidthSpec'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeElasticBandwidthSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticBandwidthSpecResponseBody(name='body'),
}

/**
 * @param request DescribeElasticBandwidthSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticBandwidthSpecResponse
 */
async function describeElasticBandwidthSpecWithOptions(request: DescribeElasticBandwidthSpecRequest, runtime: Util.RuntimeOptions): DescribeElasticBandwidthSpecResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticBandwidthSpec',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeElasticBandwidthSpecRequest
 * @return DescribeElasticBandwidthSpecResponse
 */
async function describeElasticBandwidthSpec(request: DescribeElasticBandwidthSpecRequest): DescribeElasticBandwidthSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticBandwidthSpecWithOptions(request, runtime);
}

model DescribeHealthCheckListRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"ddoscoo-cn-XXXXX","Protocol":"tcp","FrontendPort":80}]'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeHealthCheckListResponseBody = {
  listeners?: [ 
    {
      frontendPort?: int32(name='FrontendPort', example='233'),
      healthCheck?: {
        domain?: string(name='Domain', example='www.aliyun.com'),
        down?: int32(name='Down', example='500'),
        interval?: int32(name='Interval', example='15'),
        port?: int32(name='Port', example='233'),
        timeout?: int32(name='Timeout', example='1000'),
        type?: string(name='Type', example='tcp'),
        up?: int32(name='Up', example='1000'),
        uri?: string(name='Uri', example='/a/b/c'),
      }(name='HealthCheck'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      protocol?: string(name='Protocol', example='tcp'),
    }
  ](name='Listeners'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeHealthCheckListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHealthCheckListResponseBody(name='body'),
}

/**
 * @param request DescribeHealthCheckListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHealthCheckListResponse
 */
async function describeHealthCheckListWithOptions(request: DescribeHealthCheckListRequest, runtime: Util.RuntimeOptions): DescribeHealthCheckListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.listeners)) {
    query['Listeners'] = request.listeners;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHealthCheckList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeHealthCheckListRequest
 * @return DescribeHealthCheckListResponse
 */
async function describeHealthCheckList(request: DescribeHealthCheckListRequest): DescribeHealthCheckListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHealthCheckListWithOptions(request, runtime);
}

model DescribeHealthCheckStatusListRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"ddoscoo-cn-XXXXX","Protocol":"tcp","FrontendPort":80}]'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeHealthCheckStatusListResponseBody = {
  healthCheckStatusList?: [ 
    {
      frontendPort?: int32(name='FrontendPort', example='233'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      protocol?: string(name='Protocol', example='tcp'),
      realServerStatusList?: [ 
        {
          address?: string(name='Address', example='1.1.1.1'),
          status?: string(name='Status', example='normal'),
        }
      ](name='RealServerStatusList'),
      status?: string(name='Status', example='normal'),
    }
  ](name='HealthCheckStatusList'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeHealthCheckStatusListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHealthCheckStatusListResponseBody(name='body'),
}

/**
 * @param request DescribeHealthCheckStatusListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHealthCheckStatusListResponse
 */
async function describeHealthCheckStatusListWithOptions(request: DescribeHealthCheckStatusListRequest, runtime: Util.RuntimeOptions): DescribeHealthCheckStatusListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.listeners)) {
    query['Listeners'] = request.listeners;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHealthCheckStatusList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeHealthCheckStatusListRequest
 * @return DescribeHealthCheckStatusListResponse
 */
async function describeHealthCheckStatusList(request: DescribeHealthCheckStatusListRequest): DescribeHealthCheckStatusListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHealthCheckStatusListWithOptions(request, runtime);
}

model DescribeInstanceDetailsRequest {
  instanceIds?: string(name='InstanceIds', description='This parameter is required.', example='["ddoscoo-cn-XXXX1", "ddoscoo-cn-XXXX2"]'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeInstanceDetailsResponseBody = {
  instanceDetails?: [ 
    {
      eipInfoList?: [ 
        {
          eip?: string(name='Eip', example='1.1.1.1'),
          status?: string(name='Status', example='normal'),
        }
      ](name='EipInfoList'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      line?: string(name='Line', example='coop-line-001'),
    }
  ](name='InstanceDetails'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeInstanceDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceDetailsResponseBody(name='body'),
}

/**
 * @param request DescribeInstanceDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceDetailsResponse
 */
async function describeInstanceDetailsWithOptions(request: DescribeInstanceDetailsRequest, runtime: Util.RuntimeOptions): DescribeInstanceDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceDetails',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstanceDetailsRequest
 * @return DescribeInstanceDetailsResponse
 */
async function describeInstanceDetails(request: DescribeInstanceDetailsRequest): DescribeInstanceDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceDetailsWithOptions(request, runtime);
}

model DescribeInstanceSpecsRequest {
  instanceIds?: string(name='InstanceIds', description='This parameter is required.', example='["ddoscoo-cn-XXXXX"]'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeInstanceSpecsResponseBody = {
  instanceSpecs?: [ 
    {
      bandwidthMbps?: int32(name='BandwidthMbps', example='20000'),
      baseBandwidth?: int32(name='BaseBandwidth', example='20'),
      defenseCount?: int32(name='DefenseCount', example='10'),
      domainLimit?: int32(name='DomainLimit', example='50'),
      elasticBandwidth?: int32(name='ElasticBandwidth', example='20'),
      functionVersion?: string(name='FunctionVersion', example='default'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      portLimit?: int32(name='PortLimit', example='50'),
      qpsLimit?: int32(name='QpsLimit', example='1000'),
      siteLimit?: int32(name='SiteLimit', example='10'),
    }
  ](name='InstanceSpecs'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeInstanceSpecsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSpecsResponseBody(name='body'),
}

/**
 * @param request DescribeInstanceSpecsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSpecsResponse
 */
async function describeInstanceSpecsWithOptions(request: DescribeInstanceSpecsRequest, runtime: Util.RuntimeOptions): DescribeInstanceSpecsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceSpecs',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstanceSpecsRequest
 * @return DescribeInstanceSpecsResponse
 */
async function describeInstanceSpecs(request: DescribeInstanceSpecsRequest): DescribeInstanceSpecsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceSpecsWithOptions(request, runtime);
}

model DescribeInstanceStatisticsRequest {
  instanceIds?: string(name='InstanceIds', description='This parameter is required.', example='[{"InstanceId":"ddoscoo-cn-XXXXX","InstanceId":"ddoscoo-cn-YYYYY"}]'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeInstanceStatisticsResponseBody = {
  instanceStatistics?: [ 
    {
      defenseCountUsage?: int32(name='DefenseCountUsage', example='1'),
      domainUsage?: int32(name='DomainUsage', example='10'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      portUsage?: int32(name='PortUsage', example='20'),
      siteUsage?: int32(name='SiteUsage', example='1'),
    }
  ](name='InstanceStatistics'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeInstanceStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceStatisticsResponseBody(name='body'),
}

/**
 * @param request DescribeInstanceStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceStatisticsResponse
 */
async function describeInstanceStatisticsWithOptions(request: DescribeInstanceStatisticsRequest, runtime: Util.RuntimeOptions): DescribeInstanceStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceStatistics',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstanceStatisticsRequest
 * @return DescribeInstanceStatisticsResponse
 */
async function describeInstanceStatistics(request: DescribeInstanceStatisticsRequest): DescribeInstanceStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceStatisticsWithOptions(request, runtime);
}

model DescribeInstancesRequest {
  edition?: int32(name='Edition', example='9'),
  enabled?: int32(name='Enabled', example='1'),
  expireEndTime?: long(name='ExpireEndTime', example='1578931200000'),
  expireStartTime?: long(name='ExpireStartTime', example='1578931200000'),
  instanceIds?: string(name='InstanceIds', example='["ddoscoo-cn-XXXXX"]'),
  ip?: string(name='Ip', example='1.1.1.1'),
  pageNo?: string(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: string(name='PageSize', description='This parameter is required.', example='10'),
  remark?: string(name='Remark', example='testRemark'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  status?: [ int32 ](name='Status', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', example='key'),
      value?: string(name='Value', example='value'),
    }
  ](name='Tag'),
}

model DescribeInstancesResponseBody = {
  instances?: [ 
    {
      debtStatus?: int32(name='DebtStatus', example='0'),
      edition?: int32(name='Edition', example='9'),
      enabled?: int32(name='Enabled', example='1'),
      expireTime?: long(name='ExpireTime', example='2308402384'),
      gmtCreate?: long(name='GmtCreate', example='2308402384'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      remark?: string(name='Remark', example='testRemark'),
      status?: int32(name='Status', example='1'),
    }
  ](name='Instances'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: long(name='Total', example='10'),
}

model DescribeInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstancesResponseBody(name='body'),
}

/**
 * @param request DescribeInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstancesResponse
 */
async function describeInstancesWithOptions(request: DescribeInstancesRequest, runtime: Util.RuntimeOptions): DescribeInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.edition)) {
    query['Edition'] = request.edition;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.expireEndTime)) {
    query['ExpireEndTime'] = request.expireEndTime;
  }
  if (!Util.isUnset(request.expireStartTime)) {
    query['ExpireStartTime'] = request.expireStartTime;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstances',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstancesRequest
 * @return DescribeInstancesResponse
 */
async function describeInstances(request: DescribeInstancesRequest): DescribeInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstancesWithOptions(request, runtime);
}

model DescribeIpTrafficRequest {
  eip?: string(name='Eip', description='This parameter is required.', example='1.1.1.1'),
  endTime?: long(name='EndTime', description='This parameter is required.', example='1536734120'),
  interval?: int32(name='Interval', description='This parameter is required.', example='60'),
  port?: int32(name='Port', example='233'),
  queryProtocol?: string(name='QueryProtocol', example='http'),
  resourceGroupId?: string(name='ResourceGroupId', example='xxx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1536734112'),
}

model DescribeIpTrafficResponseBody = {
  avgInBps?: long(name='AvgInBps', example='10000'),
  avgOutBps?: long(name='AvgOutBps', example='10000'),
  ipTrafficPoints?: [ 
    {
      actConns?: int32(name='ActConns', example='100'),
      cps?: int32(name='Cps', example='100'),
      inactConns?: int32(name='InactConns', example='100'),
      maxInbps?: long(name='MaxInbps', example='10000'),
      maxOutbps?: long(name='MaxOutbps', example='10000'),
      time?: long(name='Time', example='1536734112'),
    }
  ](name='IpTrafficPoints'),
  maxInBps?: long(name='MaxInBps', example='10000'),
  maxOutBps?: long(name='MaxOutBps', example='10000'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeIpTrafficResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIpTrafficResponseBody(name='body'),
}

/**
 * @param request DescribeIpTrafficRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIpTrafficResponse
 */
async function describeIpTrafficWithOptions(request: DescribeIpTrafficRequest, runtime: Util.RuntimeOptions): DescribeIpTrafficResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eip)) {
    query['Eip'] = request.eip;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.port)) {
    query['Port'] = request.port;
  }
  if (!Util.isUnset(request.queryProtocol)) {
    query['QueryProtocol'] = request.queryProtocol;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeIpTraffic',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeIpTrafficRequest
 * @return DescribeIpTrafficResponse
 */
async function describeIpTraffic(request: DescribeIpTrafficRequest): DescribeIpTrafficResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIpTrafficWithOptions(request, runtime);
}

model DescribeLayer4RuleAttributesRequest {
  listeners?: string(name='Listeners', description='This parameter is required.', example='[{"InstanceId":"ddoscoo-cn-XXXXX","Protocol":"tcp","FrontendPort":80}]'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeLayer4RuleAttributesResponseBody = {
  listeners?: [ 
    {
      config?: {
        cc?: {
          sblack?: [ 
            {
              cnt?: int32(name='Cnt', example='5'),
              during?: int32(name='During', example='60'),
              expires?: int32(name='Expires', example='1800'),
              type?: int32(name='Type', example='1'),
            }
          ](name='Sblack'),
        }(name='Cc'),
        nodataConn?: string(name='NodataConn', example='on'),
        payloadLen?: {
          max?: int32(name='Max', example='2'),
          min?: int32(name='Min', example='1'),
        }(name='PayloadLen'),
        persistenceTimeout?: int32(name='PersistenceTimeout', example='0'),
        sla?: {
          cps?: int32(name='Cps', example='100'),
          cpsEnable?: int32(name='CpsEnable', example='0'),
          maxconn?: int32(name='Maxconn', example='1000'),
          maxconnEnable?: int32(name='MaxconnEnable', example='0'),
        }(name='Sla'),
        slimit?: {
          bps?: long(name='Bps', example='0'),
          cps?: int32(name='Cps', example='100'),
          cpsEnable?: int32(name='CpsEnable', example='0'),
          cpsMode?: int32(name='CpsMode', example='2'),
          maxconn?: int32(name='Maxconn', example='1000'),
          maxconnEnable?: int32(name='MaxconnEnable', example='0'),
          pps?: long(name='Pps', example='0'),
        }(name='Slimit'),
        synproxy?: string(name='Synproxy', example='on'),
      }(name='Config'),
      frontendPort?: int32(name='FrontendPort', example='233'),
      instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
      protocol?: string(name='Protocol', example='tcp'),
    }
  ](name='Listeners'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeLayer4RuleAttributesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLayer4RuleAttributesResponseBody(name='body'),
}

/**
 * @param request DescribeLayer4RuleAttributesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLayer4RuleAttributesResponse
 */
async function describeLayer4RuleAttributesWithOptions(request: DescribeLayer4RuleAttributesRequest, runtime: Util.RuntimeOptions): DescribeLayer4RuleAttributesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.listeners)) {
    query['Listeners'] = request.listeners;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLayer4RuleAttributes',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeLayer4RuleAttributesRequest
 * @return DescribeLayer4RuleAttributesResponse
 */
async function describeLayer4RuleAttributes(request: DescribeLayer4RuleAttributesRequest): DescribeLayer4RuleAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLayer4RuleAttributesWithOptions(request, runtime);
}

model DescribeLayer4RulesRequest {
  forwardProtocol?: string(name='ForwardProtocol', description='The type of forwarding protocol. Values:
- **tcp**: Indicates TCP protocol.
- **udp**: Indicates UDP protocol.', example='tcp'),
  frontendPort?: int32(name='FrontendPort', description='The forwarding port.', example='233'),
  instanceId?: string(name='InstanceId', description='The ID of the DDoS protection instance to be queried.

> You can call [DescribeInstances](https://help.aliyun.com/document_detail/91478.html) to query all DDoS protection instance IDs.

This parameter is required.', example='ddoscoo-cn-zvp2ay9b****'),
  offset?: int32(name='Offset', description='In paginated queries, specifies which page of data to return. The minimum value is **1**, indicating the first page of data.

This parameter is required.', example='1'),
  pageSize?: string(name='PageSize', description='In paginated queries, specifies the number of results per page. The maximum value is **50**, indicating that each page can contain up to 50 results.

This parameter is required.', example='10'),
  sourceIp?: string(name='SourceIp', description='The source IP address of the request. You do not need to fill this in; it is automatically obtained by the system.', example='192.0.XX.XX'),
}

model DescribeLayer4RulesResponseBody = {
  listeners?: [ 
    {
      backendPort?: int32(name='BackendPort', description='The origin server port.', example='233'),
      bakMode?: int32(name='BakMode', description='The origin mode. Values:

- **0**: Indicates the default origin mode.
- **1**: Indicates the primary/backup origin mode.', example='0'),
      currentIndex?: int32(name='CurrentIndex', description='The currently effective origin server type. Values:

- **1**: Indicates that the primary origin server settings are in effect (DDoS protection forwards business traffic to the primary origin server IP address).
- **2**: Indicates that the backup origin server settings are in effect (DDoS protection forwards business traffic to the backup origin server IP address).', example='1'),
      eip?: string(name='Eip', description='The IP address of the DDoS protection instance.', example='203.107.XX.XX'),
      frontendPort?: int32(name='FrontendPort', description='The forwarding port.', example='233'),
      instanceId?: string(name='InstanceId', description='The ID of the DDoS protection instance.', example='ddoscoo-cn-zvp2ay9b****'),
      isAutoCreate?: boolean(name='IsAutoCreate', description='Indicates whether the rule was automatically created. Values:

- **true**: Indicates that the rule was automatically created by DDoS protection.
- **false**: Indicates that the rule was manually created by you.', example='false'),
      payloadRuleEnable?: long(name='PayloadRuleEnable', description='Payload rule module switch. Values:

- 1: Enabled
- 0: Disabled', example='0'),
      protocol?: string(name='Protocol', description='The type of forwarding protocol.', example='tcp'),
      proxyEnable?: int32(name='ProxyEnable', description='Traffic diversion switch. Values:
- **0** Off.
- **1** On.', example='0'),
      proxyStatus?: string(name='ProxyStatus', description='Traffic diversion status. Values:

- on: Diversion is effective
- off: Diversion is ineffective', example='on'),
      realServers?: [ string ](name='RealServers', description='The list of origin server IP addresses.'),
      remark?: string(name='Remark', description='The remarks for the port forwarding rule.', example='test-remark'),
      usTimeout?: {
        connectTimeout?: long(name='ConnectTimeout'),
        rsTimeout?: long(name='RsTimeout'),
      }(name='UsTimeout'),
    }
  ](name='Listeners', description='Detailed configuration of port forwarding rules, including the forwarding port, forwarding protocol, and origin server addresses, etc.'),
  requestId?: string(name='RequestId', description='The ID of the current request.', example='949919A2-6636-1444-9213-AB27DD88AAA8'),
  total?: long(name='Total', description='The number of returned results.', example='1'),
}

model DescribeLayer4RulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLayer4RulesResponseBody(name='body'),
}

/**
 * @summary Call DescribeLayer4Rules to query the detailed configuration of port forwarding rules for DDoS protection instances.
 *
 * @param request DescribeLayer4RulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLayer4RulesResponse
 */
async function describeLayer4RulesWithOptions(request: DescribeLayer4RulesRequest, runtime: Util.RuntimeOptions): DescribeLayer4RulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.forwardProtocol)) {
    query['ForwardProtocol'] = request.forwardProtocol;
  }
  if (!Util.isUnset(request.frontendPort)) {
    query['FrontendPort'] = request.frontendPort;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLayer4Rules',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Call DescribeLayer4Rules to query the detailed configuration of port forwarding rules for DDoS protection instances.
 *
 * @param request DescribeLayer4RulesRequest
 * @return DescribeLayer4RulesResponse
 */
async function describeLayer4Rules(request: DescribeLayer4RulesRequest): DescribeLayer4RulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLayer4RulesWithOptions(request, runtime);
}

model DescribeLayer7CCRulesRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  offset?: int32(name='Offset', description='This parameter is required.', example='0'),
  pageSize?: string(name='PageSize', description='This parameter is required.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeLayer7CCRulesResponseBody = {
  layer7CCRules?: [ 
    {
      act?: string(name='Act', example='close'),
      count?: int32(name='Count', example='100'),
      interval?: int32(name='Interval', example='60'),
      mode?: string(name='Mode', example='match'),
      name?: string(name='Name', example='testCcRule1'),
      ttl?: int32(name='Ttl', example='1000'),
      uri?: string(name='Uri', example='/a/b/c'),
    }
  ](name='Layer7CCRules'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: long(name='Total', example='10'),
}

model DescribeLayer7CCRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLayer7CCRulesResponseBody(name='body'),
}

/**
 * @param request DescribeLayer7CCRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLayer7CCRulesResponse
 */
async function describeLayer7CCRulesWithOptions(request: DescribeLayer7CCRulesRequest, runtime: Util.RuntimeOptions): DescribeLayer7CCRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLayer7CCRules',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeLayer7CCRulesRequest
 * @return DescribeLayer7CCRulesResponse
 */
async function describeLayer7CCRules(request: DescribeLayer7CCRulesRequest): DescribeLayer7CCRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLayer7CCRulesWithOptions(request, runtime);
}

model DescribeLogStoreExistStatusRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeLogStoreExistStatusResponseBody = {
  existStatus?: boolean(name='ExistStatus', example='true'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeLogStoreExistStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogStoreExistStatusResponseBody(name='body'),
}

/**
 * @param request DescribeLogStoreExistStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogStoreExistStatusResponse
 */
async function describeLogStoreExistStatusWithOptions(request: DescribeLogStoreExistStatusRequest, runtime: Util.RuntimeOptions): DescribeLogStoreExistStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogStoreExistStatus',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeLogStoreExistStatusRequest
 * @return DescribeLogStoreExistStatusResponse
 */
async function describeLogStoreExistStatus(request: DescribeLogStoreExistStatusRequest): DescribeLogStoreExistStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogStoreExistStatusWithOptions(request, runtime);
}

model DescribeOpEntitiesRequest {
  endTime?: long(name='EndTime', description='This parameter is required.', example='1536715558000'),
  entityObject?: string(name='EntityObject', example='xx'),
  entityType?: int32(name='EntityType', example='1'),
  opAction?: int32(name='OpAction'),
  pageNo?: int32(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1534123558000'),
}

model DescribeOpEntitiesResponseBody = {
  opEntities?: [ 
    {
      entityObject?: string(name='EntityObject', example='2.2.2.2'),
      entityType?: int32(name='EntityType', example='1'),
      gmtCreate?: long(name='GmtCreate', example='1536715558000'),
      opAccount?: string(name='OpAccount', example='123'),
      opAction?: int32(name='OpAction', example='1'),
      opDesc?: string(name='OpDesc', example='{"newEntity":{"elasticBandwidth":30},"oldEntity":{"elasticBandwidth":200}}'),
    }
  ](name='OpEntities'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: long(name='Total', example='10'),
}

model DescribeOpEntitiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOpEntitiesResponseBody(name='body'),
}

/**
 * @param request DescribeOpEntitiesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOpEntitiesResponse
 */
async function describeOpEntitiesWithOptions(request: DescribeOpEntitiesRequest, runtime: Util.RuntimeOptions): DescribeOpEntitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.entityObject)) {
    query['EntityObject'] = request.entityObject;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.opAction)) {
    query['OpAction'] = request.opAction;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOpEntities',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeOpEntitiesRequest
 * @return DescribeOpEntitiesResponse
 */
async function describeOpEntities(request: DescribeOpEntitiesRequest): DescribeOpEntitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOpEntitiesWithOptions(request, runtime);
}

model DescribeSimpleDomainsRequest {
  instanceIds?: [ string ](name='InstanceIds', example='ddoscoo-cn-XXXXXX'),
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeSimpleDomainsResponseBody = {
  domainList?: [ string ](name='DomainList'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeSimpleDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSimpleDomainsResponseBody(name='body'),
}

/**
 * @param request DescribeSimpleDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSimpleDomainsResponse
 */
async function describeSimpleDomainsWithOptions(request: DescribeSimpleDomainsRequest, runtime: Util.RuntimeOptions): DescribeSimpleDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSimpleDomains',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeSimpleDomainsRequest
 * @return DescribeSimpleDomainsResponse
 */
async function describeSimpleDomains(request: DescribeSimpleDomainsRequest): DescribeSimpleDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSimpleDomainsWithOptions(request, runtime);
}

model DescribeSlsAuthStatusRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeSlsAuthStatusResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  slsAuthStatus?: boolean(name='SlsAuthStatus', example='true'),
}

model DescribeSlsAuthStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlsAuthStatusResponseBody(name='body'),
}

/**
 * @param request DescribeSlsAuthStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlsAuthStatusResponse
 */
async function describeSlsAuthStatusWithOptions(request: DescribeSlsAuthStatusRequest, runtime: Util.RuntimeOptions): DescribeSlsAuthStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlsAuthStatus',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeSlsAuthStatusRequest
 * @return DescribeSlsAuthStatusResponse
 */
async function describeSlsAuthStatus(request: DescribeSlsAuthStatusRequest): DescribeSlsAuthStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlsAuthStatusWithOptions(request, runtime);
}

model DescribeSlsEmptyCountRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeSlsEmptyCountResponseBody = {
  availableCount?: int32(name='AvailableCount', example='0'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribeSlsEmptyCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlsEmptyCountResponseBody(name='body'),
}

/**
 * @param request DescribeSlsEmptyCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlsEmptyCountResponse
 */
async function describeSlsEmptyCountWithOptions(request: DescribeSlsEmptyCountRequest, runtime: Util.RuntimeOptions): DescribeSlsEmptyCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlsEmptyCount',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeSlsEmptyCountRequest
 * @return DescribeSlsEmptyCountResponse
 */
async function describeSlsEmptyCount(request: DescribeSlsEmptyCountRequest): DescribeSlsEmptyCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlsEmptyCountWithOptions(request, runtime);
}

model DescribeSlsLogstoreInfoRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeSlsLogstoreInfoResponseBody = {
  logStore?: string(name='LogStore', example='ddoscoo-logstore'),
  project?: string(name='Project', example='ddoscoo-project-xxxx-cn-hangzhou'),
  quota?: long(name='Quota', example='5497558138880'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  ttl?: int32(name='Ttl'),
  used?: long(name='Used', example='0'),
}

model DescribeSlsLogstoreInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlsLogstoreInfoResponseBody(name='body'),
}

/**
 * @param request DescribeSlsLogstoreInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlsLogstoreInfoResponse
 */
async function describeSlsLogstoreInfoWithOptions(request: DescribeSlsLogstoreInfoRequest, runtime: Util.RuntimeOptions): DescribeSlsLogstoreInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlsLogstoreInfo',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeSlsLogstoreInfoRequest
 * @return DescribeSlsLogstoreInfoResponse
 */
async function describeSlsLogstoreInfo(request: DescribeSlsLogstoreInfoRequest): DescribeSlsLogstoreInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlsLogstoreInfoWithOptions(request, runtime);
}

model DescribeSlsOpenStatusRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribeSlsOpenStatusResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  slsOpenStatus?: boolean(name='SlsOpenStatus', example='true'),
}

model DescribeSlsOpenStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlsOpenStatusResponseBody(name='body'),
}

/**
 * @param request DescribeSlsOpenStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlsOpenStatusResponse
 */
async function describeSlsOpenStatusWithOptions(request: DescribeSlsOpenStatusRequest, runtime: Util.RuntimeOptions): DescribeSlsOpenStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlsOpenStatus',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeSlsOpenStatusRequest
 * @return DescribeSlsOpenStatusResponse
 */
async function describeSlsOpenStatus(request: DescribeSlsOpenStatusRequest): DescribeSlsOpenStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlsOpenStatusWithOptions(request, runtime);
}

model DescribleCertListRequest {
  domain?: string(name='Domain', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribleCertListResponseBody = {
  certList?: [ 
    {
      certIdentifier?: string(name='CertIdentifier'),
      common?: string(name='Common', example='www.aliyun.com'),
      domainRelated?: boolean(name='DomainRelated', example='false'),
      endDate?: string(name='EndDate', example='2020-09-23'),
      id?: int32(name='Id', example='123'),
      issuer?: string(name='Issuer', example='DigiCert Inc'),
      name?: string(name='Name', example='testCertName'),
      startDate?: string(name='StartDate', example='2019-09-24'),
    }
  ](name='CertList'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribleCertListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribleCertListResponseBody(name='body'),
}

/**
 * @param request DescribleCertListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribleCertListResponse
 */
async function describleCertListWithOptions(request: DescribleCertListRequest, runtime: Util.RuntimeOptions): DescribleCertListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribleCertList',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribleCertListRequest
 * @return DescribleCertListResponse
 */
async function describleCertList(request: DescribleCertListRequest): DescribleCertListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describleCertListWithOptions(request, runtime);
}

model DescribleLayer7InstanceRelationsRequest {
  domainList?: [ string ](name='DomainList', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DescribleLayer7InstanceRelationsResponseBody = {
  layer7InstanceRelations?: [ 
    {
      domain?: string(name='Domain', example='www.aliyun.com'),
      instanceDetails?: [ 
        {
          eipList?: [ string ](name='EipList'),
          functionVersion?: string(name='FunctionVersion', example='default'),
          instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
          ipMode?: string(name='IpMode'),
          ipVersion?: string(name='IpVersion'),
        }
      ](name='InstanceDetails'),
    }
  ](name='Layer7InstanceRelations'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DescribleLayer7InstanceRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribleLayer7InstanceRelationsResponseBody(name='body'),
}

/**
 * @param request DescribleLayer7InstanceRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribleLayer7InstanceRelationsResponse
 */
async function describleLayer7InstanceRelationsWithOptions(request: DescribleLayer7InstanceRelationsRequest, runtime: Util.RuntimeOptions): DescribleLayer7InstanceRelationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainList)) {
    query['DomainList'] = request.domainList;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribleLayer7InstanceRelations',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribleLayer7InstanceRelationsRequest
 * @return DescribleLayer7InstanceRelationsResponse
 */
async function describleLayer7InstanceRelations(request: DescribleLayer7InstanceRelationsRequest): DescribleLayer7InstanceRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describleLayer7InstanceRelationsWithOptions(request, runtime);
}

model DisableLayer7CCRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DisableLayer7CCResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DisableLayer7CCResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableLayer7CCResponseBody(name='body'),
}

/**
 * @param request DisableLayer7CCRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableLayer7CCResponse
 */
async function disableLayer7CCWithOptions(request: DisableLayer7CCRequest, runtime: Util.RuntimeOptions): DisableLayer7CCResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableLayer7CC',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DisableLayer7CCRequest
 * @return DisableLayer7CCResponse
 */
async function disableLayer7CC(request: DisableLayer7CCRequest): DisableLayer7CCResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableLayer7CCWithOptions(request, runtime);
}

model DisableLayer7CCRuleRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model DisableLayer7CCRuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model DisableLayer7CCRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableLayer7CCRuleResponseBody(name='body'),
}

/**
 * @param request DisableLayer7CCRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableLayer7CCRuleResponse
 */
async function disableLayer7CCRuleWithOptions(request: DisableLayer7CCRuleRequest, runtime: Util.RuntimeOptions): DisableLayer7CCRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableLayer7CCRule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DisableLayer7CCRuleRequest
 * @return DisableLayer7CCRuleResponse
 */
async function disableLayer7CCRule(request: DisableLayer7CCRuleRequest): DisableLayer7CCRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableLayer7CCRuleWithOptions(request, runtime);
}

model EmptySlsLogstoreRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model EmptySlsLogstoreResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model EmptySlsLogstoreResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EmptySlsLogstoreResponseBody(name='body'),
}

/**
 * @param request EmptySlsLogstoreRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EmptySlsLogstoreResponse
 */
async function emptySlsLogstoreWithOptions(request: EmptySlsLogstoreRequest, runtime: Util.RuntimeOptions): EmptySlsLogstoreResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EmptySlsLogstore',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EmptySlsLogstoreRequest
 * @return EmptySlsLogstoreResponse
 */
async function emptySlsLogstore(request: EmptySlsLogstoreRequest): EmptySlsLogstoreResponse {
  var runtime = new Util.RuntimeOptions{};
  return emptySlsLogstoreWithOptions(request, runtime);
}

model EnableLayer7CCRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model EnableLayer7CCResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model EnableLayer7CCResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableLayer7CCResponseBody(name='body'),
}

/**
 * @param request EnableLayer7CCRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableLayer7CCResponse
 */
async function enableLayer7CCWithOptions(request: EnableLayer7CCRequest, runtime: Util.RuntimeOptions): EnableLayer7CCResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableLayer7CC',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EnableLayer7CCRequest
 * @return EnableLayer7CCResponse
 */
async function enableLayer7CC(request: EnableLayer7CCRequest): EnableLayer7CCResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableLayer7CCWithOptions(request, runtime);
}

model EnableLayer7CCRuleRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.aliyun.com'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model EnableLayer7CCRuleResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model EnableLayer7CCRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableLayer7CCRuleResponseBody(name='body'),
}

/**
 * @param request EnableLayer7CCRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableLayer7CCRuleResponse
 */
async function enableLayer7CCRuleWithOptions(request: EnableLayer7CCRuleRequest, runtime: Util.RuntimeOptions): EnableLayer7CCRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableLayer7CCRule',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request EnableLayer7CCRuleRequest
 * @return EnableLayer7CCRuleResponse
 */
async function enableLayer7CCRule(request: EnableLayer7CCRuleRequest): EnableLayer7CCRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableLayer7CCRuleWithOptions(request, runtime);
}

model ListAsyncTaskRequest {
  lang?: string(name='Lang', example='cn'),
  pageNo?: int32(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model ListAsyncTaskResponseBody = {
  asyncTasks?: [ 
    {
      endTime?: long(name='EndTime', example='1533866201000'),
      startTime?: long(name='StartTime', example='1533866201000'),
      taskId?: long(name='TaskId', example='123'),
      taskParams?: string(name='TaskParams', example='{"instanceId": "ddoscoo-1234-qrq2134"}'),
      taskResult?: string(name='TaskResult', example='{"instanceId": "ddoscoo-1234-qrq2134", "url": "https://oss.xxx.xxx"}'),
      taskStatus?: int32(name='TaskStatus', example='1'),
      taskType?: int32(name='TaskType', example='1'),
    }
  ](name='AsyncTasks'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  total?: int32(name='Total', example='10'),
}

model ListAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAsyncTaskResponseBody(name='body'),
}

/**
 * @param request ListAsyncTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAsyncTaskResponse
 */
async function listAsyncTaskWithOptions(request: ListAsyncTaskRequest, runtime: Util.RuntimeOptions): ListAsyncTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAsyncTask',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListAsyncTaskRequest
 * @return ListAsyncTaskResponse
 */
async function listAsyncTask(request: ListAsyncTaskRequest): ListAsyncTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAsyncTaskWithOptions(request, runtime);
}

model ListLayer7CustomPortsRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model ListLayer7CustomPortsResponseBody = {
  layer7CustomPorts?: [ 
    {
      flag?: string(name='Flag'),
      proxyPorts?: [ string ](name='ProxyPorts'),
      proxyType?: string(name='ProxyType', example='https'),
    }
  ](name='Layer7CustomPorts'),
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ListLayer7CustomPortsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLayer7CustomPortsResponseBody(name='body'),
}

/**
 * @param request ListLayer7CustomPortsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLayer7CustomPortsResponse
 */
async function listLayer7CustomPortsWithOptions(request: ListLayer7CustomPortsRequest, runtime: Util.RuntimeOptions): ListLayer7CustomPortsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLayer7CustomPorts',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListLayer7CustomPortsRequest
 * @return ListLayer7CustomPortsResponse
 */
async function listLayer7CustomPorts(request: ListLayer7CustomPortsRequest): ListLayer7CustomPortsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listLayer7CustomPortsWithOptions(request, runtime);
}

model ListTagKeysRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='INSTANCE'),
}

model ListTagKeysResponseBody = {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='97935DF1-0289-4AA2-9DD1-72377838B16B'),
  tagKeys?: [ 
    {
      tagCount?: int32(name='TagCount', example='1'),
      tagKey?: string(name='TagKey', example='a'),
    }
  ](name='TagKeys'),
  totalCount?: int32(name='TotalCount', example='6'),
}

model ListTagKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagKeysResponseBody(name='body'),
}

/**
 * @param request ListTagKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagKeysResponse
 */
async function listTagKeysWithOptions(request: ListTagKeysRequest, runtime: Util.RuntimeOptions): ListTagKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagKeys',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListTagKeysRequest
 * @return ListTagKeysResponse
 */
async function listTagKeys(request: ListTagKeysRequest): ListTagKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagKeysWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', example='RGuYpqDdKhzXb8C3.D1BwQgc1tMBsoxdGiEKHHUUCffomr'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  resourceId?: [ string ](name='ResourceId', example='ddoscoo-cn-o4017n9q9004'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', example='testKey1'),
      value?: string(name='Value', example='testValue1'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', example='RGuYpqDdKhzXb8C3.D1BwQgc1tMBsoxdGiEKHHUUCffomr'),
  requestId?: string(name='RequestId', example='C3F7E6AE-43B2-4730-B6A3-FD17552B8F65'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', example='ddoscoo-cn-o4017n9q9004'),
      resourceType?: string(name='ResourceType', example='INSTANCE'),
      tagKey?: string(name='TagKey', example='testKey1'),
      tagValue?: string(name='TagValue', example='testValue1'),
    }
  ](name='TagResource')
  }(name='TagResources'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListValueAddedRequest {
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model ListValueAddedResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
  valueAddedList?: [ 
    {
      expireTime?: long(name='ExpireTime', example='1580918400000'),
      gmtCreate?: long(name='GmtCreate', example='1575527305000'),
      instanceId?: string(name='InstanceId', example='ddos_fl_pre-cn-xxxx'),
      logSize?: long(name='LogSize', example='5497558138880'),
      status?: int32(name='Status', example='1'),
      storeRegion?: string(name='StoreRegion'),
    }
  ](name='ValueAddedList'),
}

model ListValueAddedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListValueAddedResponseBody(name='body'),
}

/**
 * @param request ListValueAddedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListValueAddedResponse
 */
async function listValueAddedWithOptions(request: ListValueAddedRequest, runtime: Util.RuntimeOptions): ListValueAddedResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListValueAdded',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListValueAddedRequest
 * @return ListValueAddedResponse
 */
async function listValueAdded(request: ListValueAddedRequest): ListValueAddedResponse {
  var runtime = new Util.RuntimeOptions{};
  return listValueAddedWithOptions(request, runtime);
}

model ModifyElasticBandWidthRequest {
  elasticBandwidth?: int32(name='ElasticBandwidth', description='This parameter is required.', example='30'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ddoscoo-cn-XXXXX'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model ModifyElasticBandWidthResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ModifyElasticBandWidthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyElasticBandWidthResponseBody(name='body'),
}

/**
 * @param request ModifyElasticBandWidthRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyElasticBandWidthResponse
 */
async function modifyElasticBandWidthWithOptions(request: ModifyElasticBandWidthRequest, runtime: Util.RuntimeOptions): ModifyElasticBandWidthResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.elasticBandwidth)) {
    query['ElasticBandwidth'] = request.elasticBandwidth;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyElasticBandWidth',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyElasticBandWidthRequest
 * @return ModifyElasticBandWidthResponse
 */
async function modifyElasticBandWidth(request: ModifyElasticBandWidthRequest): ModifyElasticBandWidthResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyElasticBandWidthWithOptions(request, runtime);
}

model ModifyFullLogTtlRequest {
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
  ttl?: int32(name='Ttl', description='This parameter is required.', example='30'),
}

model ModifyFullLogTtlResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ModifyFullLogTtlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyFullLogTtlResponseBody(name='body'),
}

/**
 * @param request ModifyFullLogTtlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyFullLogTtlResponse
 */
async function modifyFullLogTtlWithOptions(request: ModifyFullLogTtlRequest, runtime: Util.RuntimeOptions): ModifyFullLogTtlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  if (!Util.isUnset(request.ttl)) {
    query['Ttl'] = request.ttl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyFullLogTtl',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyFullLogTtlRequest
 * @return ModifyFullLogTtlResponse
 */
async function modifyFullLogTtl(request: ModifyFullLogTtlRequest): ModifyFullLogTtlResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyFullLogTtlWithOptions(request, runtime);
}

model ModifyInstanceRemarkRequest {
  instanceId?: string(name='InstanceId', example='ddoscoo-cn-XXXXX'),
  remark?: string(name='Remark'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model ModifyInstanceRemarkResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ModifyInstanceRemarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceRemarkResponseBody(name='body'),
}

/**
 * @param request ModifyInstanceRemarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceRemarkResponse
 */
async function modifyInstanceRemarkWithOptions(request: ModifyInstanceRemarkRequest, runtime: Util.RuntimeOptions): ModifyInstanceRemarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceRemark',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyInstanceRemarkRequest
 * @return ModifyInstanceRemarkResponse
 */
async function modifyInstanceRemark(request: ModifyInstanceRemarkRequest): ModifyInstanceRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceRemarkWithOptions(request, runtime);
}

model OpenDomainSlsConfigRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='www.example.com'),
  lang?: string(name='Lang', example='cn'),
  resourceGroupId?: string(name='ResourceGroupId', example='xx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model OpenDomainSlsConfigResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model OpenDomainSlsConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenDomainSlsConfigResponseBody(name='body'),
}

/**
 * @param request OpenDomainSlsConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenDomainSlsConfigResponse
 */
async function openDomainSlsConfigWithOptions(request: OpenDomainSlsConfigRequest, runtime: Util.RuntimeOptions): OpenDomainSlsConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenDomainSlsConfig',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request OpenDomainSlsConfigRequest
 * @return OpenDomainSlsConfigResponse
 */
async function openDomainSlsConfig(request: OpenDomainSlsConfigRequest): OpenDomainSlsConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return openDomainSlsConfigWithOptions(request, runtime);
}

model ReleaseInstanceRequest {
  instanceId?: string(name='InstanceId'),
  sourceIp?: string(name='SourceIp'),
}

model ReleaseInstanceResponseBody = {
  requestId?: string(name='RequestId'),
}

model ReleaseInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseInstanceResponseBody(name='body'),
}

/**
 * @param request ReleaseInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseInstanceResponse
 */
async function releaseInstanceWithOptions(request: ReleaseInstanceRequest, runtime: Util.RuntimeOptions): ReleaseInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseInstance',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReleaseInstanceRequest
 * @return ReleaseInstanceResponse
 */
async function releaseInstance(request: ReleaseInstanceRequest): ReleaseInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseInstanceWithOptions(request, runtime);
}

model ReleaseValueAddedRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ddos_fl_pre-cn-xxxx'),
  sourceIp?: string(name='SourceIp', example='1.1.1.1'),
}

model ReleaseValueAddedResponseBody = {
  requestId?: string(name='RequestId', example='CF33B4C3-196E-4015-AADD-5CAD00057B80'),
}

model ReleaseValueAddedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseValueAddedResponseBody(name='body'),
}

/**
 * @param request ReleaseValueAddedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseValueAddedResponse
 */
async function releaseValueAddedWithOptions(request: ReleaseValueAddedRequest, runtime: Util.RuntimeOptions): ReleaseValueAddedResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sourceIp)) {
    query['SourceIp'] = request.sourceIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseValueAdded',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReleaseValueAddedRequest
 * @return ReleaseValueAddedResponse
 */
async function releaseValueAdded(request: ReleaseValueAddedRequest): ReleaseValueAddedResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseValueAddedWithOptions(request, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.', example='ddoscoo-cn-v0h1fmwbc024'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', example='testKey1'),
      value?: string(name='Value', example='testValue1'),
    }
  ](name='Tag'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', example='7078CD1E-F609-47A4-9C39-B288CC27C686'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', example='false'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='test'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.', example='ddoscoo-cn-v0h1fmwbc024'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='INSTANCE'),
  tagKey?: [ string ](name='TagKey', example='testKey1'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', example='F2D86AED-BA27-4584-BADC-B43BDA7EEBCA'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2017-12-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

